<template>
	<view class="flex-colume-start orderDetail">
		<view class="flex-colume-start" style="width: 690rpx; background-color: white;">
			<view v-if="order" @click="goodsClick()"  class="flex-row-start order-item">
				<image class="leftImg" :src="order.goods_info.thumb"></image>
				<view class="flex-colume-start right11">
					<view class="text-two-line t2">{{order.goods_info.goods_name}}</view>
					<view class="t3">¥<span style="font-size: 32rpx; font-weight: 500;">{{order.total_amount}}</span>
					<!-- <span style="margin-left: 8rpx;">已有{{}}人买下</span> -->
					</view>
				
				</view>
			</view>
			<view v-if="order" class="flex-colume-start" style="padding: 25rpx; width: 100%;">
				<view class="flex-row-start item1">
					<view class="t1">订单编号</view>
					<view class="flex-row-start t2">
						<view style="color: #C90000;">{{order.order_status_label}}</view>
						
					</view>
				</view>
				<view class="flex-row-start item1">
					<view class="t1">订单状态</view>
					<view class="flex-row-start t2">
						<view style="color: rgb(153, 153, 153);">{{order.order_sn}}</view>
						<view @click="copyBtnClick()" style="margin-left: 10rpx; padding-left: 10rpx; border-left: 1px solid rgb(230, 230, 230);">复制</view>
					</view>
				</view>
				<view class="flex-row-start item1 item2">
					<view class="t1">收货信息</view>
					<view class="flex-colume-start t2" style="color: rgb(153, 153, 153); align-items: flex-end;">
						<view>{{order.address_info.consignee}}，{{order.address_info.telephone}}，{{order.address_info.province_name}} {{order.address_info.city_name}} {{order.address_info.quan
}}</view>
						<view>{{order.address_info.address}}</view>
					</view>
				</view>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	import {
		orderDetail
	} from '@/api/api'
	import request from '@/api/request'
	export default {
		data() {
			return {
				order:undefined
			}
		},
		onLoad(e){
			orderDetail({order_id:e.id}).then(res=>{
				if (res.code == 200){
					this.order = res.data
				}
				
			})
			
		},
		methods: {
			goodsClick(){
				uni.navigateTo({
					url:'/pages/goods/goodsDetail?id='+this.order.goods_info.id
				})
			},
			copyBtnClick(){
				uni.setClipboardData({
					data:this.order.order_sn
				})
				uni.showToast({
					title:'复制成功',
					icon:'none'
				})
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	.orderDetail{
		padding-top: 30rpx;
		.order-item{
			width: 690rpx;
			background-color: white;
			padding: 25rpx;
			border-radius: 16rpx;
			margin-bottom: 20rpx;
			.leftImg{
				width: 160rpx;
				height: 160rpx;
				flex-shrink: 0;
				border-radius: 16rpx;
				margin-right: 20rpx;
			}
			.right11{
				flex: 1;
				position: relative;
				align-items: flex-start;
				height: 160rpx;
				.t2{
					margin-top: 10rpx;
					font-size: 28rpx;
					color: black;
				}
				.t3{
					position: absolute;
					bottom: 0rpx;
					left: 0rpx;
					font-size: 24rpx;
					color: #C90000;
				}
				
				// .t4{
				// 	position: absolute;
				// 	right: 0rpx;
				// 	top: 0rpx;
				// 	font-size: 26rpx;
				// 	line-height: 32rpx;
				// 	font-weight: 450;
				// 	color: #C90000;
					
				// }
			}
		}
		.item1{
			width: 100%;
			justify-content: space-between;
			font-size: 28rpx;
			margin-bottom: 18rpx;
			.t2{
				font-size: 26rpx;
			}
			
		}
		.item2{
			align-items: flex-start;


			line-height: 40rpx;
			
			-webkit-line-height: 40rpx; /* 兼容Webkit内核浏览器 */
			
			
			
		}
		

	}

</style>
